package com.xdh.zzqh.ui

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.MotionEvent
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import com.xdh.zzqh.utils.hideSoftKey


open class BaseActivity : AppCompatActivity() {


    companion object {
        lateinit var INSTANCE: BaseActivity
            private set

        fun parentView(): View {
            return INSTANCE.window.decorView
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        INSTANCE = this
    }

    override fun onResume() {
        super.onResume()
        INSTANCE = this
    }

    override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
        if (ev.action == MotionEvent.ACTION_DOWN) {
            hideSoftKey(this)
        }
        return super.dispatchTouchEvent(ev)
    }



}